Send E-Mail
The activity sends a mail. What happens afterwards depends on one thing only: the node that directly follows the activity.
| Node behind the activity | Behaviour |
|---|---|
| anything else (activity, end, variable, regular decision, ...) | One-shot. The mail is sent and the workflow continues at once. |
the click response decision (decision.email) | Wait for an answer. The mail is sent, the workflow is saved and sleeps until a link is clicked or a timeout fires. |
The text of the mail does not decide this. A ${action.x} link in the text does not put the workflow to sleep,
and a click response decision without any link in the mail still makes the workflow sleep (until a timeout).
The decision is the only switch.
One-shot mail​
Connect the activity to the node that should continue. The workflow does not wait.
The label of the single outgoing edge is not used (next is the usual name, but just next or no label at all works
the same), because an activity with one way out always takes that edge.
Do not put ${action.x} links in the text of a one-shot mail: there is no decision that could answer them,
so they are not turned into links.
Waiting for an answer​
Put a click response decision directly behind the activity. Then
- every outgoing edge
xof the decision (excepttimeout) is an answer the user can choose. It becomes a link${action.x}that you can place in the mail text (the editor offers them); - after sending, the workflow is saved and sleeps;
- a click on a link wakes the workflow and it continues on the edge
x.
The edge from the activity to the decision needs no special label. It must be the only outgoing edge of the activity.
Timeout​
The decision needs an edge timeout, the diagram check reports an error without it. The edge is only taken
if something fires it: put a Wakeup Timer with sleep later in front of the mail. Without a timer the
workflow sleeps until the user clicks a link, however long that takes.
The timeout edge has no link in the mail.
Several mails in one run​
A run that sleeps behind a click response decision has exactly one open answer. The next mail of the same run may only put it to sleep again after the answer came in (or the timeout fired); this is what a loop in a diagram does.
Examples​
The colours of the nodes are the ones of the editor palette: e-mail #e1f5fe, timer #fffde7, start and end dark.
Approval by mail​
A manager is asked to approve an order. Each answer continues on its own edge; a manager who does not answer within two days is escalated. The follow-up mails are one-shot.
The workflow sleeps at the click response decision. A click on approve wakes it up and continues on that edge; the timeout edge is taken only if the timer fires first.
One-shot: send and continue​
The mail has no answer. The workflow continues at once with the next step.
Further reading: SMTP, the protocol that sends the mail.